package pack1;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class ConnectionFactory {

	Connection conn;
	
	public Connection getOracleConnection() throws ClassNotFoundException, SQLException{
	
		Class.forName("oracle.jdbc.driver.OracleDriver");
		System.out.println("Driver Loaded");
		
		Properties p=new Properties();
		p.put("user","scott");
		p.put("password", "oracle");
		
		String url = "jdbc:oracle:thin:@//localhost:1521/orcl";

		Connection conn=DriverManager.getConnection(url,p);
		System.out.println("Connection Object obtained");
		
		return conn;
	}
	
	
}
